Security and Authentication

Customize Page Security Enforcement

Description
This customization illustrates how to customize the way a page enforces security requirements. An example of this is implementing a non-role-based access requirement.
Variables
Applies to
Page class
Code
 
''' 
''' Authorize sub is called during the load phase.
''' 
Public Overrides Sub Authorize(ByVal roles As String)

    ' NOTE: if role-based security was configured through Iron Speed Designer,
    ' and the page was configured to allow specific roles, those roles will be
    ' passed to this function in the roles parameter as a 
    ' semi-colon-delimited list of values:  Role1;Role2;etc.

    If ("Your business logic here") Then
        Me.RedirectToForbiddenPage()
    Else
        MyBase.Authorize(roles)
    End If
    
    ' Note: If your custom enforcement code must interact with the page's controls (e.g. RecordControls) after 
    ' they have had their data loaded from the database, then you can add an event handler for one of 
    ' the page's events (e.g. DataBinding, Load, or PreRender) which can conditionally redirect to the 
    ' Forbidden page, Sign In page, etc.
End Sub



     

Terms of Service Privacy Statement